<div id="menu">
    <ul>
        <li><a href="index.php">Home</a></li>
        {if !isset($user) || (isset($user) && !$user->isLogged())}
            <li class="first"><a href="login.php">Login</a></li>
            <li><a href="register.php">Registazione</a></li>
        {/if}
        <li><a href="forum.php">Forum</a></li>
        {if isset($user) && $user->isLogged()}
            <li><a href="profile.php?username={$user->username}">Profilo</a></li>
        {/if}
        {if isset($user) && $user->isLogged() && $user->isAdmin()}
            <li><a href="admin.php">Admin</a></li>
        {/if}
        <li><a href="stats.php">Statistiche</a></li>
    </ul>
    <div id="login_username">{if isset($user) && $user->isLogged()}<a id="login_name"> Benvenuto, {$user->getUsername()} </a> [ <a href="index.php?action=logout" class="barra">logout</a> ]{/if}</div>
</div>